package com.sfh.cpc;

import android.Manifest;
import android.os.Bundle;

import com.sfh.cpc.com.ui.BasePermissionsActivity;
import com.sfh.lib.exception.HandleException;
import com.sfh.lib.rx.IResult;
import com.sfh.lib.rx.RetrofitManager;

import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;

/**
 * 功能描述:
 *
 * @author SunFeihu 孙飞虎
 * @date 2019/5/27
 */
public class IndexActivity   extends BasePermissionsActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

      Disposable disposable =  RetrofitManager.executeSigin(Observable.timer(3000, TimeUnit.MILLISECONDS), new IResult<Long>() {
            @Override
            public void onFail(HandleException e) {

            }

            @Override
            public void onSuccess(Long aLong) throws Exception {

                MainActivity.startUI(IndexActivity.this);
                finish();
            }
        });
      postEvent(disposable);
    }


    @Override
    public String[] getPermissions() {
        return new String[]{Manifest.permission.CAMERA,Manifest.permission.WRITE_EXTERNAL_STORAGE};
    }
}
